package abq2.jic.jic.plugin.operate.job;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.entity.datamodel.ListSelectedRow;
import kd.bos.form.FormShowParameter;
import kd.bos.form.MobileFormShowParameter;
import kd.bos.form.ShowType;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.events.BeforeDoOperationEventArgs;
import kd.bos.form.operate.FormOperate;
import kd.bos.list.BillList;
import kd.sdk.plugin.Plugin;

/**
 * 单据界面插件
 * 招聘信息的列表的插件，用于列出所有的招聘信息，点击查看后弹窗，在弹窗中可以查看招聘的具体信息
 */
public class ShowJobsForm extends AbstractBillPlugIn implements Plugin {
    @Override
    public void beforeDoOperation(BeforeDoOperationEventArgs e) {

        super.beforeDoOperation(e);
        String operateKey = ((FormOperate) e.getSource()).getOperateKey();
        if(operateKey.equals("showjobs")){
            BillList billlist = this.getControl("abq2_billlistap");
            ListSelectedRow currentSelectedRowInfo = billlist.getCurrentSelectedRowInfo();
            Object primaryKeyValue = currentSelectedRowInfo.getPrimaryKeyValue();

            //弹窗界面
            FormShowParameter formShowParameter = new MobileFormShowParameter();
            formShowParameter.setFormId("abq2_job_windows");
            formShowParameter.setCustomParam("jobId",primaryKeyValue);//将指定的pkid传给弹窗
            formShowParameter.getOpenStyle().setShowType(ShowType.Modal);
            this.getView().showForm(formShowParameter);
        }
    }
    @Override
    public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
        super.afterDoOperation(afterDoOperationEventArgs);
    }
}